
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <assert.h>

using namespace std;

class Solution
{
public:
    bool uniqueOccurrences(vector<int> &arr)
    {
        unordered_map<int, int> umInt;
        for (const auto &x : arr)
        {
            umInt[x]++;
        }
        unordered_set<int> times;
        for (const auto &x : umInt)
        {
            times.insert(x.second);
        }
        return times.size() == umInt.size();
    }
};

int main()
{
    vector<int> v1{1,2,3,4,5};
    vector<int> v2{1,2,2,3,3,3};
    Solution s;
    assert(s.uniqueOccurrences(v1) == false);
    assert(s.uniqueOccurrences(v2) == true);
    return 0;
}